<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        // 数组：存储一组相同类型的数据

        // var arr = [1,2,3,45,6] ;

        // var arr2 = ['a' , 'b' , 'c'] ;

        // var arr3 = [
        //     function () {} ,
        //     function () {} ,
        //     function () {} ,
        //     function () {} ,
        // ]

        var arr4 = [
            [1,2,3] , 
            ['a','v' , 5 , 6 , 8] ,
            [7,8,9]
        ] ;


        console.log(arr4) ;

        console.log(arr4[0]) ;

        console.log(arr4[0][0]) ; // 1


        // 二维数组的遍历

        for(var i = 0 ; i < arr4.length ; i++) {
            for(var j = 0 ; j < arr4[i].length ; j++) {
                console.log(arr4[i][j]) ;
            }
        }



        // concat

        function concat() {
            // console.log(arguments) ;
            var newArr = [] ;
            for(var i = 0 ; i < arguments.length ; i++) {
                for(var j = 0 ; j < arguments[i].length ; j++) {
                    newArr.push(arguments[i][j]) ;
                }
            }

            console.log(newArr) ;
        }


        concat([1,2,3] , ['q' ,'m'])



    </script>
    
</body>
</html>